//
//  OKSickCaseTextView.m
//  ZLFastDoctor
//
//  Created by answer on 16/5/26.
//  Copyright © 2016年 LS. All rights reserved.
//

#import "OKSickCaseTextView.h"

@interface OKSickCaseTextView () 

@end

@implementation OKSickCaseTextView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.layer.borderColor = [UIColor redColor].CGColor;
        self.layer.borderWidth = 3;
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    if (self = [super initWithCoder:aDecoder]) {
        self.layer.borderColor = [UIColor lightGrayColor].CGColor;
        self.layer.borderWidth = 1;
        self.layer.cornerRadius = 5;
    }
    return self;
}

- (void)drawRect:(CGRect)rect {
    
    NSString *str = self.holdString;
    //直接绘制
    // 从哪里开始绘制 -- 文字的属性 --UIKit 第一个头文件
    NSDictionary *dict = @{NSFontAttributeName : [UIFont systemFontOfSize:12],NSForegroundColorAttributeName:[UIColor lightGrayColor]};
    //在某块区域内绘制--超出部分不显示
    [str drawInRect:CGRectMake(5, 8, self.bounds.size.width, 100) withAttributes:dict];
    
}


@end
